Skip to content

Add charging and preconditioning actions to Teslemetry #144184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 17 commits into
base: dev
Choose a base branch
from

Conversation

Bre77
Copy link
Contributor

@Bre77 Bre77 commented May 4, 2025

Proposed change

Add charging and preconditioning actions to Teslemetry

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:
  • Link to developer documentation pull request:
  • Link to frontend pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

@Bre77 Bre77 changed the title T charge schedule service Add charging and preconditioning actions to Teslemetry May 4, 2025
@Bre77 Bre77 force-pushed the t-charge-schedule-service branch from 59dcc5d to 250d025 Compare May 6, 2025 04:21
@Bre77 Bre77 marked this pull request as ready for review May 6, 2025 04:25
@Bre77 Bre77 requested a review from NoRi2909 May 6, 2025 04:34
@Bre77 Bre77 force-pushed the t-charge-schedule-service branch from 250d025 to a72fe9d Compare May 7, 2025 01:02
@Bre77 Bre77 force-pushed the t-charge-schedule-service branch from a72fe9d to 91fe192 Compare May 9, 2025 01:26
Copy link
Contributor

@NoRi2909 NoRi2909 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good, just one small typo.

@home-assistant home-assistant bot marked this pull request as draft May 26, 2025 15:45
@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@Bre77 Bre77 marked this pull request as ready for review May 29, 2025 06:32
@home-assistant home-assistant bot requested a review from joostlek May 29, 2025 06:32
@Bre77 Bre77 requested a review from NoRi2909 May 29, 2025 07:10
Comment on lines 147 to 153
- "[%key:common::time::monday%]"
- "[%key:common::time::tuesday%]"
- "[%key:common::time::wednesday%]"
- "[%key:common::time::thursday%]"
- "[%key:common::time::friday%]"
- "[%key:common::time::saturday%]"
- "[%key:common::time::sunday%]"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct me if I'm wrong, but I think this is not recommended.
So far I have only seen these in strings.json:

  "selector": {
    "days_of_week": {
      "options": {
        "monday": "[%key:common::time::monday%]",
        "tuesday": "[%key:common::time::tuesday%]",
        "wednesday": "[%key:common::time::wednesday%]",
        "thursday": "[%key:common::time::thursday%]",
        "friday": "[%key:common::time::friday%]",
        "saturday": "[%key:common::time::saturday%]",
        "sunday": "[%key:common::time::sunday%]"
      }
    }
  }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is days_of_week actually a core selector? https://www.home-assistant.io/docs/blueprint/selectors/

I found references to it in custom integrations but its undocumented in core.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I wrote, you should keep the selector as it was and only update the strings.json to reference the common strings instead of redefining "Monday" to "Sunday".

@Bre77
Copy link
Contributor Author

Bre77 commented Jun 21, 2025

Hey @joostlek any chance we can finish this review before beta?

Copy link
Member

@joostlek joostlek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It kinda feels like this is just doing more than just adding actions as its also refactoring older actions, would it make sense to split it

Comment on lines 147 to 153
- "[%key:common::time::monday%]"
- "[%key:common::time::tuesday%]"
- "[%key:common::time::wednesday%]"
- "[%key:common::time::thursday%]"
- "[%key:common::time::friday%]"
- "[%key:common::time::saturday%]"
- "[%key:common::time::sunday%]"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

translation references only work in strings.json

use a translation key here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you translate selector values? I cant find any examples or references on how to do that? https://developers.home-assistant.io/blog/2023/07/11/translating-services/

@home-assistant home-assistant bot marked this pull request as draft June 22, 2025 22:15
@Bre77
Copy link
Contributor Author

Bre77 commented Jun 23, 2025

It kinda feels like this is just doing more than just adding actions as its also refactoring older actions, would it make sense to split it

I have removed everything not-related to the 4 new services and will put them in seperately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants